package com.dongjiantong.openplatform.exceptions;/**
 * Created by cao on 2017/12/13.
 */

/**
 * @author cao
 * @create 2017-12-13 下午7:52
 **/
public abstract class OPException extends RuntimeException {
    private static final long serialVersionUID = -3244090102284160027L;
    protected int code = 400;
    protected String reason = "Bad Request";
    protected Object[] args;

    public OPException(int status, String reason) {
        super(reason);
        this.code = status;
        this.reason = reason;
    }

    public OPException(int status, String reason, Object... args) {
        super(reason);
        this.code = status;
        this.reason = reason;
        this.args = args;
    }

    public int getStatus() {
        return this.code;
    }

    public Object[] getArgs() {
        return this.args;
    }

    public String getReason() {
        return this.reason;
    }
}